package com.easyexcel.demo.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.easyexcel.demo.entity.User;
import com.easyexcel.demo.vo.UserQuery;
import com.easyexcel.demo.vo.UserRequest;
import com.easyexcel.demo.vo.UserVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author zhaoxh
 * @since 2023-09-13 21:23:44
 */
public interface UserService extends IService<User> {
    /**
     * 分页
     *
     * @param query
     * @return
     */
    Page<UserVO> page(UserQuery query);


    /**
     * 批量导入
     *
     * @param requests
     */
    void reqSaveBath(List<UserRequest> requests);


    /**
     * 分批导出
     *
     * @param request
     * @param response
     * @param query
     */
    void exportExcel(HttpServletRequest request, HttpServletResponse response, UserQuery query);

    /**
     *  使用模板导出
     *
     * @param request
     * @param response
     * @param query
     */
    void exportExcelV3(HttpServletRequest request, HttpServletResponse response, UserQuery query);

    /**
     * 模板导入
     *
     * @param request
     * @param response
     * @param file
     * @return
     */
    Boolean importExcel(HttpServletRequest request, HttpServletResponse response, MultipartFile file);
}